package cn.samler.shopapi.Model.Sys;

import lombok.Data;

@Data
public class ServiceResult {
    private boolean success;
    private Object data;

    private ServiceResult(boolean success, Object data) {
        this.success = success;
        this.data = data;
    }

    public static ServiceResult success() {
        return new ServiceResult(true, null);
    }

    public static ServiceResult success(Object data) {
        return new ServiceResult(true, data);
    }

    public static ServiceResult failure(Object data) {
        return new ServiceResult(false, data);
    }

}
